home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / omswitch.zip / SWITCHAR.ASM < prev   
Assembly Source File  |  1988-09-02  |  994b  |  36 lines

  1. ; :ts=8
  2. ; Set/get the option separator character via the undocumented DOS call 0x37.
  3. ; Call from c:
  4. ;    char switchar(char switch);
  5. ; If switch is greater than a space, it is set to the current switch character.
  6. ; In any case, the function returns the current/new switch character.
  7. ; Compile with NODOS3 true to generate code to disable this code on DOS 3.0
  8. ; and higher and always return "/".
  9.  
  10. ; (c) 1988 Otto Makela, Jyvaskyla, Finland
  11.     include    lmacros.h
  12.     procdef    switchar,<<switch,byte>>
  13.  
  14.     ifdef    NODOS3
  15.     mov    ah,030h        ; Retrieve DOS version
  16.     int    021h
  17.     cmp    al,3        ; Less than 3.0 ?
  18.     mov    al,'/'        ; Simulate switchar
  19.     jae    skip2        ; Less, skip
  20.     endif
  21.  
  22.     mov    dl,switch    ; Load switch character
  23.     cmp    dl,' '        ; Less or equal to space ?
  24.     jbe    skip1        ; Yes, can't be switchar
  25.  
  26.     mov    ax,03701h    ; Subfunction one = set switchar
  27.     int    021h
  28.  
  29. skip1:    mov    ax,03700h    ; Subfunction zero = get switchar
  30.     int    021h
  31.     mov    al,dl        ; Load return value
  32. skip2:    pret
  33.     pend    switchar
  34.     finish
  35.     end
  36.